package lesson14;

public class CarDemo {

	public static void main(String[] args) {
		
		Car ford = new Car();
		Car volvo = new Car();
		
		Person ivan = new Person();
		ivan.name = "Ivan";
		ivan.age = 25;
		Person maria = new Person();
		maria.name = "Maria";
		maria.age = 26;
		
		ford.model = "Fiesta";
		ford.maxSpeed = 198;
		ford.currentSpeed = 90;
		ford.color = "red";
		ford.gear = 4;
		ford.owner = ivan;
		
		volvo.model = "V40";
		volvo.maxSpeed = 200;
		volvo.currentSpeed = 42;
		volvo.color = "blue";
		volvo.gear = 3;
		volvo.owner = maria;

		
		System.out.println("Model: " + ford.model + ", " + volvo.model);
		System.out.println("Max speed: " + ford.maxSpeed + ", " + volvo.maxSpeed);
		System.out.println("Current speed: " + ford.currentSpeed + ", " + volvo.currentSpeed);
		System.out.println("Color: " + ford.color + ", " + volvo.color);
		System.out.println("Gear: " + ford.gear + ", " + volvo.gear);
		System.out.println("Owner: " + ford.owner + ", " + volvo.owner);
		System.out.println("Owner age: " + ivan.age + ", " + maria.age);
		
		System.out.println();
		
		ford.maxSpeed = 160;
		volvo.maxSpeed = 210;
		
		ford.currentSpeed = 60;
		volvo.currentSpeed = 125;
		
		System.out.println("Model: " + ford.model + ", " + volvo.model);
		System.out.println("Max speed: " + ford.maxSpeed + ", " + volvo.maxSpeed);
		System.out.println("Current speed: " + ford.currentSpeed + ", " + volvo.currentSpeed);
		System.out.println("Color: " + ford.color + ", " + volvo.color);
		System.out.println("Gear: " + ford.gear + ", " + volvo.gear);
		
		//
		
		ford.accelerate(33);
		volvo.accelerate(51);
		
		ford.chnageGearDown();
		volvo.changeGearUp();
				
		ford.changeColor("green");
		volvo.changeColor("yellow");
		
		System.out.println("Model: " + ford.model + ", " + volvo.model);
		System.out.println("Max speed: " + ford.maxSpeed + ", " + volvo.maxSpeed);
		System.out.println("Current speed: " + ford.currentSpeed + ", " + volvo.currentSpeed);
		System.out.println("Color: " + ford.color + ", " + volvo.color);
		System.out.println("Gear: " + ford.gear + ", " + volvo.gear);
		
		ford.changeGear(5);
		volvo.changeGear(6);
		
				
		
		System.out.println("Model: " + ford.model + ", " + volvo.model);
		System.out.println("Max speed: " + ford.maxSpeed + ", " + volvo.maxSpeed);
		System.out.println("Current speed: " + ford.currentSpeed + ", " + volvo.currentSpeed);
		System.out.println("Color: " + ford.color + ", " + volvo.color);
		System.out.println("Gear: " + ford.gear + ", " + volvo.gear);
		
	}

}
